package cn.itcast.mapper;

import cn.itcast.pojo.Student;
import cn.itcast.pojo.StudentQueryParam;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

@Mapper
public interface StudentMapper {
    List<Student> page(StudentQueryParam studentQueryParam);

    void save(Student student);

    Student getById(@Param("id") Integer id);

    void update(Student student);

    void deleteBatch( @Param("idsList") List<Integer> idsList);

    void violationAddScore(@Param("id") Integer id,@Param("score") Integer score);

    @MapKey("clazz")
    List<Map> studentCountData();


    List<Map> studentDegreeData();

    @Select("select COUNT(*) from student where clazz_id = #{id}")
    Integer countByClazzId(@Param("id") Integer id);
}
